package com.qqtech.qquan.user.service;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.qqtech.core.frame.dao.BaseDao;
import com.qqtech.core.frame.model.PageOrder;
import com.qqtech.core.frame.service.BaseServiceImpl;
import com.qqtech.qquan.user.dao.UserBlackDao;
import com.qqtech.qquan.user.model.*;

@Service
public class UserBlackServiceImpl extends BaseServiceImpl<UserBlack>
		implements UserBlackService {
	public static final Logger log = LoggerFactory.getLogger(UserBlackServiceImpl.class);
	
	@Resource
	private UserBlackDao userBlackDao;

	@Override
	protected BaseDao<UserBlack> getBaseDao() {
		return userBlackDao;
	}

	@Override
	public boolean isBlack(Integer creatorId, Integer blackId) {
		boolean isBlack=false;
		UserBlackQuery userBlackQuery=new UserBlackQuery();
		userBlackQuery.setCreatorId(creatorId);
		userBlackQuery.setBlackId(blackId);
		UserBlackVo userBlackVo=userBlackDao.getOne(userBlackQuery, new PageOrder());
		if(null!=userBlackVo){
			isBlack=true;
		}
		return isBlack;
	}
	
}